package kg.gtss.utils;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class FileUtils {
	public static void copyBigDataTo(InputStream inStream, String strOutFileName)
			throws IOException {
		if (null == inStream)
			return;
		OutputStream myOutput = new FileOutputStream(strOutFileName);
		// myInput = this.getAssets().open(file);
		byte[] buffer = new byte[1024];
		int length = inStream.read(buffer);
		while (length > 0) {
			myOutput.write(buffer, 0, length);
			length = inStream.read(buffer);
		}
		myOutput.flush();// !!!!!!!!!VERY IMPORTANT ,cping is a long time,or
							// Text file busy.
		inStream.close();
		myOutput.close();
	}
}
